#ifndef PAGEKEYCBSTAT_H
#define PAGEKEYCBSTAT_H

#include <QWidget>
#include <QLabel>
#include <QTextStream>
#include <QButtonGroup>
#include <QFile>
#include <QTimer>
#include "global_def.h"

typedef struct Reset_Circuits
{
    int reset_id;
    int reset_cmd_id;
    int car;
    int stat;//0---close 1---open
    QString ciruitName;
    QLabel *pCiruitLabel;
}RSTCircuits;

namespace Ui {
class PageKeyCBStat;
}

class PageKeyCBStat : public QWidget
{
    Q_OBJECT

public:
    explicit PageKeyCBStat(QWidget *parent = nullptr);
    ~PageKeyCBStat();
    void setPageActive(bool xActive);
    void setCiruitBreakStat(int id,int stat);
signals:
    void returnToMaintMenu();
    void signal_ResetCircuitBreak(bool);
private slots:
    void on_Btn_Return_clicked();
    void on_Btn_Mc1_clicked();
    void on_Btn_Mp1_clicked();
    void on_Btn_Mp2_clicked();
    void on_Btn_M1_clicked();
    void on_Btn_M2_clicked();
    void on_Btn_Tc2_clicked();
    void on_ButtonReset_clicked();
private:
    Ui::PageKeyCBStat *ui;
    QList<QWidget*> m_lWidgets;
    QList<RSTCircuits> m_lRSTCirBreaks;
    int ReadRstCirBreaksConfig_and_InitWidgets(QString path);
};

#endif // PAGEKEYCBSTAT_H
